<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<c:choose>
	<c:when test="${param.actionSerial == 0 }">
		<nativeSql:sqlQueryForList
			sql="select * from t_article_comment  where f_article_id = ${param.articleId } order by f_id desc limit 0,3"
			id="articleComments" />
	</c:when>

	<c:when test="${param.actionSerial == 1 }">
		<nativeSql:sqlQueryForList
			sql="select * from t_article_comment  where f_article_id = ${param.articleId }  order by f_id desc   limit ${param.currentNumbers },3 "
			id="articleComments" />
	</c:when>
	
	<c:when test="${param.actionSerial == 2 }">
		<nativeSql:sqlQueryForList
			sql="select * from t_article_comment  where f_id = ${param.articleCommentId }"
			id="articleComments" />
	</c:when>


</c:choose>
<style type="text/css">
.feed-rep-avatar {
	float: left;
	position: relative;
	width: 64px;
	height: 64px;
	zoom: 1;
}

.feed-rep-comments-content {
	margin: -1px -2px -4px;
	max-width: 580px;
	width: 500px;
	position: relative;
	zoom: 1;
}

.blog-rep-avatar {
	display: block;
	width: 64px;
	height: 64px;
	background-position: center center;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
	text-indent: -9999px;
	outline: none;
	border: none;
	-moz-box-shadow: 0 1px 2px #b0b3b6;
	-webkit-box-shadow: 0 1px 2px #b0b3b6;
	box-shadow: 0 1px 2px #b0b3b6;
	background-color: #b0b3b6;
}

.feed-rep-more-button {
	width: 100%;
	height: 30px;
	margin-top: 5px;
	border-radius: 4px;
	padding: 2px 5px;
	cursor: pointer;
	color: rgb(23, 23, 131);
	background-color: rgba(71, 151, 145, 0.24);
}

.feed-commnet-del {
	font-size: 20px;
	margin-left: 10px;
	float: right;
	height: 16px;
	line-height: 16px;
	cursor: pointer;
}
</style>
<c:forEach items="${articleComments }" var="articleComment">

	<div id="feed-nupt-rep-content-${articleComment.f_id }" data-articleId="${articleComment.f_article_id }" title="双击回复ta吧~~~">
		<div style="padding: 5px 1px;">
			<div class="feed-act"
				style="float: right; margin-right: -3px; margin-top: -4px;">
				
				<c:if test="${me.id == articleComment.f_creator_id }">
				<a class="feed-commnet-del" title="删除该评论"
					data-article-comment-id="${articleComment.f_id }"><img
					style="max-width: 15px;opacity: 0.4;" src="${ctx }/img/delete.png"></a>
			   </c:if>
			   
			   
			</div>

			<div class="feed-rep-avatar">
				<nativeSql:sqlQueryForUnique
					sql="select f_picture_appended as avatarId,f_username as username from app_user  where f_id = ${articleComment.f_creator_id } "
					id="avatar" />
				<img alt="头像"  class="blog-rep-avatar"     <c:if test="${ articleComment.f_creator_id  == me.id}">data-from="me"</c:if>
							  rel="${ctx }/widgets/avatarInfo.jsp?userId=${article.f_creator_id }" title="${avatar.username }" 
							  src="${ctx}/user/file.action?method:previewPic&fileId=${avatar.avatarId }">
				
			</div>
			<span class="feed-rep-comments-content"
				style="margin-left: 10px; color: rgba(21, 32, 36, 0.67); font-size: 14px;">
				${articleComment.f_content}
			</span> 
			<span  style="float:right;color: rgba(189, 100, 100, 0.66);">${articleComment.f_creation_date }</span>	
			<br>
			<div style="clear: both;"></div>


		</div>
	</div>


</c:forEach>
<script type="text/javascript">
 
   $(".feed-commnet-del").live("click",function(){
	   var articleCommentId = parseInt($(this).attr("data-article-comment-id"));
	   $("#feed-nupt-rep-content-"+articleCommentId).remove();
	   $.getJSON("${ctx}/common/ProcessingClass.jsp", {"actionSerial": 2,"articleCommentId":articleCommentId,
		                                               "description":"删除博文的回复操作" }, 
		      function(json){
		          
		 });
   });
   
</script>




